#ifndef _ORACLEUTIL_HPP	
#define _ORACLEUTIL_HPP
#include "occienv.hpp"
#include <string>
#include <windows.h>
using std::string;
using namespace oracle::occi;


namespace com_oocl_monitor {
	namespace system {
		class OcciPool {
		public:
			OcciPool(const string& constr, const string& usr, const string& pwd, int maxCon = 5, int minCon = 0, int incrCon = 1);
			Connection *getConnection();
			void releaseConnection(Connection *);
			~OcciPool();

			const string Constr() const {
				return _constr;
			}

			const string Usr() const {
				return _usr;
			}

			const string Pwd() const {
				return _pwd;
			}
		private:
			OcciPool(const OcciPool&);
			OcciPool &operator=(const OcciPool&);
		private:
			OcciEnv *_occiEnv;
			//        ConnectionPool *_pool;
			StatelessConnectionPool *_pool;
			string _constr;
			string _usr;
			string _pwd;
			int _maxCon;
			int _minCon;
			int _incrCon;
		private:
			HANDLE _sem;
		};
	}
}

#endif
